<nz-card>
  <nz-alert
    *ngIf="success"
    nzBanner
    nzMessage="Comment submitted"
    nzType="success"
    nzCloseable
    (nzOnClose)="onSuccessBannerClose()"></nz-alert>
  <form
    nz-form
    (ngSubmit)="submitComment()"
    nzLayout="vertical">
    <nz-form-item *ngIf="errorMessages.length > 0">
      <cvc-form-errors-alert [errors]="errorMessages">
      </cvc-form-errors-alert>
    </nz-form-item>
    <cvc-comment-input-form [(comment)]="commentText"></cvc-comment-input-form>
    <nz-spin
      nzTip="Submitting"
      [nzSpinning]="loading">
      <nz-form-item>
        <nz-form-control>
          <cvc-form-buttons>
            <button
              type="submit"
              nz-button
              cvcOrgSelectorBtn
              nzType="primary"
              nzSize="small"
              [disabled]="loading || !(commentText !== undefined && commentText.length >= 10)"
              nz-tooltip
              [nzTooltipTrigger]="mostRecentOrg ? 'hover' : null"
              [nzTooltipTitle]="'For ' + mostRecentOrg?.name">
              Add Comment
            </button>
          </cvc-form-buttons>
        </nz-form-control>
      </nz-form-item>
    </nz-spin>
  </form>
</nz-card>
